home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / DELETE.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  822b  |  37 lines

  1. ;    DESC:    Deletes a file                                       V1.00
  2. ;    IN:    *{SEG_VAL} segment
  3. ;        *{OFFSET} offset of filename to be deleted
  4. ;    SAMPLE:    Callm    DELETE,<SEG_VAL,OFFSET>,
  5. ;    ##################################################################
  6.  
  7.     Extrn    PUSHALL:Near
  8.     Extrn    POPALL:Near
  9.     Extrn    ERRORMSG:Near
  10.  
  11. DELETEC    Segment
  12.     Assume    CS:DELETEC
  13.     Public    DELETE
  14.  
  15.                         ;notice.
  16.     DB    'DELETE   - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  17.  
  18. DELETE    Proc    Near                ;deletes a file.
  19.     Call    PUSHALL                ;save registers.
  20.  
  21.     Pop    DX                ;get filename offset.
  22.     Pop    DS                ;get filename segment.
  23.  
  24.     Mov    AH,41H                ;delete a file.
  25.     Int    21H
  26.     Jc    ERROR                ;if error, report it.
  27.  
  28.     Call    POPALL                ;restore registers.
  29.     Ret
  30.  
  31. ERROR:    Push    Ax                ;report error and abort.
  32.     Call    ERRORMSG
  33.  
  34. DELETE    Endp
  35. DELETEC    Ends
  36.     End
  37.